CSS background简写
单背景
格式如下:color image repeat position-x position-y/size(width) size(height) attachment origin clip。
1
2
3.bg{
background: #065a06 url(img/bg.jpg) no-repeat 0% 50%/100px 200px scroll padding-box content-box;
}多背景
格式如下:image repeat position-x position-y/size(width) size(height) attachment origin clip, image repeat position-x position-y/size(width) size(height) attachment origin clip。注意到 background-color 要单独写。css .bg{ background: url(img/bg.jpg) no-repeat 0% 50%/100px 200px scroll padding-box content-box, url(img/bg2.jpg) no-repeat 100% 50%/100px 100px scroll border-box padding-box; background-color: #065a06; }